<extend name="desktop_default/template/user/base_user" />
<block name="area_header">
    <link rel="stylesheet" href="__CSS__/user/info/style.css">
</block>

<block name="area_top">

</block>
<block name="user_top">

</block>
<block name="main_content">
    <div class="info">
        <div class="user-tab">
            <a class="selected" href="javascript:void(0);">基本信息</a>
            <a href="{:U('mengwu/user/sethead')}">头像上传</a>
        </div>
        <empty name="result">
            <div class="form">
                <form name="info" method="post" action="__SELF__">
                    <div class="form-group">
                        <div class="l">
                            <label for="nickname">您的昵称：*</label>
                        </div>
                        <div class="r">
                            <input id="nickname" type="text" name="nickname" value="{$user_info.nickname}">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="l"><label>您是：*</label></div>
                        <div class="r">
                            <label><input type="radio" name="sex" value="1" <eq name="user_info.sex" value="1">checked="checked"</eq> >宝爸</label>
                            <label><input type="radio" name="sex" value="0" <eq name="user_info.sex" value="0">checked="checked"</eq> >宝妈</label>
                        </div>

                    </div>
                    <div class="form-group">
                        <div class="l">
                            <label for="sign">个性签名：</label>
                        </div>
                        <div class="r">
                            <textarea id="sign" name="sign">{$user_info.sign}</textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <a class="btn save" href="javascript:void(0);">保存</a>
                    </div>
                </form>
            </div>
        </empty>
        <notempty name="result">
            <div class="result">
                <h2>{$result}</h2>
                <a class="btn btn-back" href="{:U('mengwu/user/info')}">返回</a>
            </div>
        </notempty>
    </div>

</block>
<block name="area_footer">
    <script type="text/javascript">
        var showTip = function($ele,tip){
            $(".form-group .tip").remove();
            $ele.focus();
            $ele.parent().parent().append('<div class="tip">*'+tip+'</div>');
        };
        $('.btn.save').click(function(){
            $nickname = $('#nickname');
            if($.trim($nickname.val())==''){
                showTip($nickname,'昵称不能为空');
                return;
            }
            info.submit();
        });
    </script>
</block>
